home *** CD-ROM | disk | FTP | other *** search
/ PC Player 2004 May / pc player 2004-05.iso / Demos / FarCry / Data1.cab / _C3478788694F4E019F64E3FC02421C00 < prev    next >
Encoding:
Text File  |  2004-01-06  |  37.8 KB  |  828 lines

  1.  
  2. function PipeManager:OnInitShared()
  3.     System:Log("ON INIT SHARED");
  4.  
  5.  
  6.  
  7. -- ______________________________________________________________________________________________________________________        
  8. -- -------------------------------------------------- SHARED SCRIPTS ----------------------------------------------------
  9.         AI:CreateGoalPipe("AIS_GoOn");
  10.         AI:PushGoal("AIS_GoOn","signal",0,1,"AISF_GoOn",0);
  11.         
  12.         AI:CreateGoalPipe("GoOn2sec");
  13.         AI:PushGoal("GoOn2sec","timeout",1,2);
  14.         AI:PushGoal("GoOn2sec","signal",0,1,"GoOn",0);
  15.         
  16.         AI:CreateGoalPipe("GoOn4sec");
  17.         AI:PushGoal("GoOn4sec","timeout",1,4);
  18.         AI:PushGoal("GoOn4sec","signal",0,1,"GoOn",0);
  19.     
  20.         
  21.         AI:CreateGoalPipe("AIS_Test");
  22.         AI:PushGoal("AIS_Test","bodypos",1,0);
  23.     
  24.         ------------------------------ IGNORE ---------------------------
  25.         AI:CreateGoalPipe("AIS_ignoreall");
  26.         AI:PushGoal("AIS_ignoreall","ignoreall",1,1);
  27.         
  28.         AI:CreateGoalPipe("AIS_dont_ignore");
  29.         AI:PushGoal("AIS_dont_ignore","ignoreall",1,0);
  30.         AI:PushGoal("AIS_dont_ignore","signal",0,1,"AISF_GoOn",0);
  31.         ------------------------------------------------------------------        
  32.         -------------------------------- DELAY ---------------------------
  33.         -- Delay_1
  34.         AI:CreateGoalPipe("AIS_Delay_1");
  35.         AI:PushGoal("AIS_Delay_1","timeout",1,1);
  36.         AI:PushGoal("AIS_Delay_1","signal",0,1,"AISF_GoOn",0);
  37.         
  38.         -- Delay_2
  39.         AI:CreateGoalPipe("AIS_Delay_2");
  40.         AI:PushGoal("AIS_Delay_2","timeout",1,2);
  41.         AI:PushGoal("AIS_Delay_2","signal",0,1,"AISF_GoOn",0);
  42.         
  43.         -- Delay_3
  44.         AI:CreateGoalPipe("AIS_Delay_3");
  45.         AI:PushGoal("AIS_Delay_3","timeout",1,4);
  46.         AI:PushGoal("AIS_Delay_3","signal",0,1,"AISF_GoOn",0);
  47.         
  48.         -- Delay_4
  49.         AI:CreateGoalPipe("AIS_Delay_4");
  50.         AI:PushGoal("AIS_Delay_4","timeout",1,6);
  51.         AI:PushGoal("AIS_Delay_4","signal",0,1,"AISF_GoOn",0);
  52.         
  53.         -- Delay_5
  54.         AI:CreateGoalPipe("AIS_Delay_5");
  55.         AI:PushGoal("AIS_Delay_5","timeout",1,8);
  56.         AI:PushGoal("AIS_Delay_5","signal",0,1,"AISF_GoOn",0);
  57.     
  58.         -- Delay_6
  59.         AI:CreateGoalPipe("AIS_Delay_6");
  60.         AI:PushGoal("AIS_Delay_6","timeout",1,10);
  61.         AI:PushGoal("AIS_Delay_6","signal",0,1,"AISF_GoOn",0);
  62.         
  63.         -- Delay_7
  64.         AI:CreateGoalPipe("AIS_Delay_7");
  65.         AI:PushGoal("AIS_Delay_7","timeout",1,12);
  66.         AI:PushGoal("AIS_Delay_7","signal",0,1,"AISF_GoOn",0);
  67.         
  68.         -- Delay_8
  69.         AI:CreateGoalPipe("AIS_Delay_8");
  70.         AI:PushGoal("AIS_Delay_8","timeout",1,14);
  71.         AI:PushGoal("AIS_Delay_8","signal",0,1,"AISF_GoOn",0);
  72.         ------------------------------------------------------------------
  73.         ------------------------------ searching -------------------------
  74.         -- Look for Threat
  75.         AI:CreateGoalPipe("LookForThreat");    
  76.         AI:PushGoal("LookForThreat","lookat",1,-150,-210);
  77.         AI:PushGoal("LookForThreat","timeout",1,1);
  78.         AI:PushGoal("LookForThreat","lookat",1,-90,-180);
  79.         AI:PushGoal("LookForThreat","timeout",1,1);
  80.         AI:PushGoal("LookForThreat","lookat",1,70,110);
  81.         AI:PushGoal("LookForThreat","lookat",1,-70,-110);
  82.         
  83.         -- Look for Threat GoOn
  84.         AI:CreateGoalPipe("LookForThreatGoOn");    
  85.         AI:PushGoal("LookForThreatGoOn","LookForThreat");
  86.         AI:PushGoal("LookForThreatGoOn","signal",0,1,"AISF_GoOn",0);
  87.         
  88.         -- LookLeft
  89.         AI:CreateGoalPipe("LookLeft");
  90.         AI:PushGoal("LookLeft","lookat",1,75,90);
  91.         AI:PushGoal("LookLeft","timeout",1,1,2);
  92.                 
  93.         -- LookRight
  94.         AI:CreateGoalPipe("LookRight");
  95.         AI:PushGoal("LookRight","lookat",1,-75,-90);
  96.         AI:PushGoal("LookRight","timeout",1,1,2);
  97.                 
  98.         -- LookInTargetDirection
  99.         AI:CreateGoalPipe("LookInTargetDirection");
  100.         AI:PushGoal("LookInTargetDirection","lookat",1,0,0);
  101.         AI:PushGoal("LookInTargetDirection","timeout",1,1,2);
  102.         
  103.         
  104.         -- randomly search a hide point, walk towards
  105.         AI:CreateGoalPipe("RandomSearch");
  106.         AI:PushGoal("RandomSearch","locate",0,"hidepoint");
  107.         AI:PushGoal("RandomSearch","bodypos",0,5);
  108.         AI:PushGoal("RandomSearch","run",0,0);
  109.         AI:PushGoal("RandomSearch","acqtarget",1,"");
  110.         AI:PushGoal("RandomSearch","approach",1,3);
  111.         AI:PushGoal("RandomSearch","clear",0);
  112.                 
  113.         AI:CreateGoalPipe("RandomSearchTrace");
  114.         AI:PushGoal("RandomSearchTrace","locate",0,"hidepoint");
  115.         AI:PushGoal("RandomSearchTrace","bodypos",0,5);
  116.         AI:PushGoal("RandomSearchTrace","run",0,0);
  117.         AI:PushGoal("RandomSearchTrace","pathfind",1,"");
  118.         AI:PushGoal("RandomSearchTrace","trace",1,1);
  119.         AI:PushGoal("RandomSearchTrace","clear",0);
  120.                     
  121.         AI:CreateGoalPipe("InvestigateSound");
  122.         AI:PushGoal("InvestigateSound","bodypos",1,0);
  123.         AI:PushGoal("InvestigateSound","timeout",1,5);
  124.         AI:PushGoal("InvestigateSound","run",1,0);
  125.         AI:PushGoal("InvestigateSound","approach",1,0.5);
  126.         
  127.                 
  128.         AI:CreateGoalPipe("ApproachSound");
  129.         AI:PushGoal("ApproachSound","form",1,"beacon");
  130.         AI:PushGoal("ApproachSound","locate",1,"beacon");
  131.         AI:PushGoal("ApproachSound","acqtarget",1,"");
  132.         AI:PushGoal("ApproachSound","bodypos",0,0);
  133.         AI:PushGoal("ApproachSound","run",0,0);
  134.         AI:PushGoal("ApproachSound","hide",1,10,HM_NEAREST);
  135.         AI:PushGoal("ApproachSound","bodypos",0,5);
  136.         AI:PushGoal("ApproachSound","run",0,0);
  137.         AI:PushGoal("ApproachSound","timeout",1,1);
  138.         AI:PushGoal("ApproachSound","hide",1,10,HM_NEAREST_TO_TARGET);
  139.         AI:PushGoal("ApproachSound","timeout",1,0,1);
  140.         AI:PushGoal("ApproachSound","branch",0,-3,1);    -- this will loop until there is no more hiding points
  141.         AI:PushGoal("ApproachSound","approach",1,0.5);
  142.         
  143.         ------------------------------------------------------------------
  144.         ------------------------------ beacon ----------------------------
  145.         AI:CreateGoalPipe("AIS_DropBeacon");
  146.         AI:PushGoal("AIS_DropBeacon","form",1,"beacon");
  147.         
  148.         AI:CreateGoalPipe("DropBeaconAt");
  149.         AI:PushGoal("DropBeaconAt","form",1,"beacon");
  150.         
  151.         AI:CreateGoalPipe("DropBeaconTarget");
  152.         AI:PushGoal("DropBeaconTarget","form",0,"beacon");
  153.         AI:PushGoal("DropBeaconTarget","locate",0,"beacon");
  154.         AI:PushGoal("DropBeaconTarget","acqtarget",0,"");
  155.         
  156.         
  157.         AI:CreateGoalPipe("AcqBeacon");
  158.         AI:PushGoal("AcqBeacon","acqtarget",0,"beacon");
  159.         
  160.         
  161.         AI:CreateGoalPipe("DropBeaconSignal");
  162.         AI:PushGoal("DropBeaconSignal","DropBeaconAt");
  163.         AI:PushGoal("DropBeaconSignal","signal",0,1,"DropedBeacon",0);
  164.         ------------------------------------------------------------------
  165.         ---------------------- Reinforcement -----------------------------
  166.         AI:CreateGoalPipe("AIS_GoForReinforcement");
  167.         AI:PushGoal("AIS_GoForReinforcement","ignoreall",1,1);
  168.         AI:PushGoal("AIS_GoForReinforcement","DropBeaconAt");
  169.         AI:PushGoal("AIS_GoForReinforcement","signal",1,1,"OnGroupMemberDied",SIGNALFILTER_SPECIESONLY);
  170.         AI:PushGoal("AIS_GoForReinforcement","setup_idle");
  171.         AI:PushGoal("AIS_GoForReinforcement","run",0,1);
  172. --        AI:PushGoal("AIS_GoForReinforcement","acqtarget",1,"");
  173.         AI:PushGoal("AIS_GoForReinforcement","pathfind",1,"");
  174.         AI:PushGoal("AIS_GoForReinforcement","signal",1,1,"GET_REINFORCEMENTS",SIGNALID_READIBILITY);
  175.         AI:PushGoal("AIS_GoForReinforcement","trace",1,1);
  176.         AI:PushGoal("AIS_GoForReinforcement","signal",1,1,"CALL_REINFORCEMENTS",SIGNALID_READIBILITY);
  177. --        AI:PushGoal("AIS_GoForReinforcement","timeout",1,2);
  178.         AI:PushGoal("AIS_GoForReinforcement","signal",1,1,"TELL_LEADER_BAD_NEWS",SIGNALID_READIBILITY);
  179.         AI:PushGoal("AIS_GoForReinforcement","signal",1,1,"wakeup",SIGNALFILTER_ANYONEINCOMM);
  180.         AI:PushGoal("AIS_GoForReinforcement","signal",1,1,"AISF_CallForHelp",SIGNALFILTER_ANYONEINCOMM);
  181.         AI:PushGoal("AIS_GoForReinforcement","setup_combat");
  182.         AI:PushGoal("AIS_GoForReinforcement","signal",1,1,"RETURN_TO_PREVIOUS",0);
  183.         AI:PushGoal("AIS_GoForReinforcement","clear",0)
  184.         AI:PushGoal("AIS_GoForReinforcement","ignoreall",1,0);
  185.  
  186.  
  187.         ------------------------------------------------------------------
  188.         ---------------------- SeenByGroupMember -------------------------
  189.         AI:CreateGoalPipe("PlayerSeenByGroupMember");
  190.         AI:PushGoal("PlayerSeenByGroupMember","LookForThreat");
  191.         AI:PushGoal("PlayerSeenByGroupMember","bodypos",0,0);
  192.         AI:PushGoal("PlayerSeenByGroupMember","run",0,1);
  193.         AI:PushGoal("PlayerSeenByGroupMember","timeout",1,0.2);
  194.         AI:PushGoal("PlayerSeenByGroupMember","acqtarget",1,"");
  195.         AI:PushGoal("PlayerSeenByGroupMember","approach",1,5);
  196.         AI:PushGoal("PlayerSeenByGroupMember","LookForThreat");
  197.         
  198.         AI:CreateGoalPipe("PlayerSeenByGroupMemberIndoor");
  199.         AI:PushGoal("PlayerSeenByGroupMemberIndoor","bodypos",1,0);
  200.         AI:PushGoal("PlayerSeenByGroupMemberIndoor","run",1,1);
  201.         AI:PushGoal("PlayerSeenByGroupMemberIndoor","timeout",1,0.5);
  202.         AI:PushGoal("PlayerSeenByGroupMemberIndoor","pathfind",1,"");
  203.         AI:PushGoal("PlayerSeenByGroupMemberIndoor","timeout",1,0.5);
  204.         AI:PushGoal("PlayerSeenByGroupMemberIndoor","trace",1,1);
  205.         AI:PushGoal("PlayerSeenByGroupMemberIndoor","LookForThreat");
  206.         ------------------------------------------------------------------
  207.         ------------------------ TeamMemberDied --------------------------
  208.         -- Team Member Died
  209.         AI:CreateGoalPipe("TeamMemberDied");
  210.         AI:PushGoal("TeamMemberDied","timeout",1,0.2);
  211.         AI:PushGoal("TeamMemberDied","locate",1,"beacon");
  212.         AI:PushGoal("TeamMemberDied","acqtarget",1,"");
  213.         AI:PushGoal("TeamMemberDied","bodypos",1,0);
  214.         AI:PushGoal("TeamMemberDied","run",1,1);
  215.         AI:PushGoal("TeamMemberDied","timeout",1,1);
  216.         AI:PushGoal("TeamMemberDied","hide",1,10,HM_NEAREST,1);
  217.         AI:PushGoal("TeamMemberDied","bodypos",1,5);
  218.         AI:PushGoal("TeamMemberDied","run",1,0);
  219.         
  220.         AI:CreateGoalPipe("TeamMemberDiedLook");
  221.         AI:PushGoal("TeamMemberDiedLook","TeamMemberDied");
  222.         AI:PushGoal("TeamMemberDiedLook","timeout",0,1000);        
  223.         AI:PushGoal("TeamMemberDiedLook","LookForThreat");
  224.         AI:PushGoal("TeamMemberDiedLook","branch",1,-1);
  225.                 
  226.         AI:CreateGoalPipe("TeamMemberDiedBeaconGoOn");
  227.         AI:PushGoal("TeamMemberDiedBeaconGoOn","DropBeaconAt");        
  228.         AI:PushGoal("TeamMemberDiedBeaconGoOn","TeamMemberDied");
  229.         AI:PushGoal("TeamMemberDiedBeaconGoOn","clear",0);
  230.         AI:PushGoal("TeamMemberDiedBeaconGoOn","signal",0,1,"DEATH_CONFIRMED",SIGNALFILTER_GROUPONLY);
  231.         
  232.         AI:CreateGoalPipe("ChooseManner");
  233.         AI:PushGoal("ChooseManner","timeout",1,1,2);
  234.         AI:PushGoal("ChooseManner","signal",0,1,"ChooseManner",0);
  235.         
  236.         -- approach dead body beacon
  237.         AI:CreateGoalPipe("ApproachDeadBeacon");
  238.         AI:PushGoal("ApproachDeadBeacon","bodypos",0,5);
  239.         AI:PushGoal("ApproachDeadBeacon","run",0,0);
  240.         AI:PushGoal("ApproachDeadBeacon","locate",1,"beacon");
  241.         AI:PushGoal("ApproachDeadBeacon","acqtarget",1,"");
  242.         AI:PushGoal("ApproachDeadBeacon","approach",1,3);
  243.         AI:PushGoal("ApproachDeadBeacon","clear",0);
  244.         AI:PushGoal("ApproachDeadBeacon","LookForThreat");
  245.         AI:PushGoal("ApproachDeadBeacon","RandomSearch");
  246.                 
  247.         -- approach dead body beacon
  248.         AI:CreateGoalPipe("ApproachDeadBeaconTrace");
  249.         AI:PushGoal("ApproachDeadBeaconTrace","bodypos",0,5);
  250.         AI:PushGoal("ApproachDeadBeaconTrace","run",0,0);
  251.         AI:PushGoal("ApproachDeadBeaconTrace","locate",1,"beacon");
  252.         AI:PushGoal("ApproachDeadBeaconTrace","pathfind",1,"");
  253.         AI:PushGoal("ApproachDeadBeaconTrace","trace",1,1);
  254.         AI:PushGoal("ApproachDeadBeaconTrace","LookForThreat");
  255.         AI:PushGoal("ApproachDeadBeaconTrace","RandomSearch");
  256.         
  257.         -- Recognice Corpse
  258.         AI:CreateGoalPipe("RecogCorpse");
  259.         AI:PushGoal("RecogCorpse","form",1,"beacon");
  260.         AI:PushGoal("RecogCorpse","locate",1,"beacon");
  261.         AI:PushGoal("RecogCorpse","acqtarget",1,"");
  262.         AI:PushGoal("RecogCorpse","bodypos",0,0);
  263.         AI:PushGoal("RecogCorpse","run",1,1);
  264.         AI:PushGoal("RecogCorpse","hide",1,20,HM_NEAREST);
  265.         AI:PushGoal("RecogCorpse","bodypos",0,BODYPOS_STEALTH);
  266.         AI:PushGoal("RecogCorpse","run",1,0);
  267.         AI:PushGoal("RecogCorpse","hide",1,10,HM_NEAREST_TO_LASTOPRESULT);
  268.         AI:PushGoal("RecogCorpse","timeout",1,0,1);
  269.         AI:PushGoal("RecogCorpse","branch",0,-2,1);    -- this will loop until there is no more hiding points
  270.         AI:PushGoal("RecogCorpse","acqtarget",1,"");
  271.         AI:PushGoal("RecogCorpse","approach",1,1);
  272.         AI:PushGoal("RecogCorpse","timeout",1,1);
  273.         AI:PushGoal("RecogCorpse","signal",1,1,"death_recognition",0);
  274.         AI:PushGoal("RecogCorpse","timeout",1,2);
  275.         AI:PushGoal("RecogCorpse","signal",1,1,"DEATH_CONFIRMED",SIGNALFILTER_GROUPONLY);
  276.         ------------------------------------------------------------------
  277.         ------------------------ Formation -------------------------------
  278.         AI:CreateGoalPipe("MoveFormation");
  279.         AI:PushGoal("MoveFormation","ignoreall",1,1);
  280.         AI:PushGoal("MoveFormation","run",0,1);
  281.         AI:PushGoal("MoveFormation","locate",1,"formation");
  282.         AI:PushGoal("MoveFormation","acqtarget",1,"");
  283.         AI:PushGoal("MoveFormation","approach",1,1);
  284.         AI:PushGoal("MoveFormation","ignoreall",1,0);
  285.         
  286.         AI:CreateGoalPipe("PatrolFormation");
  287.         AI:PushGoal("PatrolFormation","timeout",1,0.5);
  288.         AI:PushGoal("PatrolFormation","locate",1,"formation");
  289.         AI:PushGoal("PatrolFormation","acqtarget",1,"");        
  290.         AI:PushGoal("PatrolFormation","approach",1,1);
  291.                 
  292.         AI:CreateGoalPipe("RegainFormation");
  293.         AI:PushGoal("RegainFormation","signal",0,1,"MOVE_IN_FORMATION",0);    
  294.                                 
  295.         AI:CreateGoalPipe("FormWoodwalk");
  296.         AI:PushGoal("FormWoodwalk","form",1,"woodwalk");
  297.         ------------------------------------------------------------------
  298.         -- go to tag 
  299.         AI:CreateGoalPipe("AIS_GoToTag");
  300.         AI:PushGoal("AIS_GoToTag","signal",0,1,"JoinGroup",SIGNALFILTER_LASTOP);    
  301.         AI:PushGoal("AIS_GoToTag","timeout",1,0.5);
  302.         AI:PushGoal("AIS_GoToTag","form",0,"wedge");
  303.         AI:PushGoal("AIS_GoToTag","timeout",1,0.5);
  304.         AI:PushGoal("AIS_GoToTag","signal",0,1,"wakeup",SIGNALFILTER_SUPERGROUP);    
  305.         AI:PushGoal("AIS_GoToTag","signal",0,1,"MOVE_IN_FORMATION",SIGNALFILTER_SUPERGROUP);    
  306.         AI:PushGoal("AIS_GoToTag","run",0,1);
  307.         AI:PushGoal("AIS_GoToTag","bodypos",0,BODYPOS_STAND);
  308.         AI:PushGoal("AIS_GoToTag","firecmd",1,1);
  309.         AI:PushGoal("AIS_GoToTag","locate",1,"beacon");
  310.         AI:PushGoal("AIS_GoToTag","acqtarget",1,"");
  311.         AI:PushGoal("AIS_GoToTag","approach",1,1);
  312.         AI:PushGoal("AIS_GoToTag","timeout",1,1);
  313.         
  314.         ------------------------------------------------------------------
  315.         -------------------------- Job -----------------------------------
  316.         -- acquire fenceanchor
  317.         AI:CreateGoalPipe("AcqFenceAnchor");
  318.         AI:PushGoal("AcqFenceAnchor","locate",1,AIAnchor.AIANCHOR_FENCE);
  319.         AI:PushGoal("AcqFenceAnchor","acqtarget",1,"");
  320.         AI:PushGoal("AcqFenceAnchor","ApproachAnchor");
  321.                 
  322.         -- acquire pissanchor
  323.         AI:CreateGoalPipe("AcqPissAnchor");
  324.         AI:PushGoal("AcqPissAnchor","locate",1,AIAnchor.AIANCHOR_PISS);
  325.         AI:PushGoal("AcqPissAnchor","acqtarget",1,"");
  326.         AI:PushGoal("AcqPissAnchor","ApproachAnchor");
  327.                 
  328.         -- acquire smokeanchor
  329.         AI:CreateGoalPipe("AcqSmokeAnchor");
  330.         AI:PushGoal("AcqSmokeAnchor","locate",1,AIAnchor.AIANCHOR_SMOKE);
  331.         AI:PushGoal("AcqSmokeAnchor","acqtarget",1,"");
  332.         AI:PushGoal("AcqSmokeAnchor","ApproachAnchor");
  333.         
  334.         -- acquire animalanchor
  335.         AI:CreateGoalPipe("AcqAnimalAnchor");
  336.         AI:PushGoal("AcqAnimalAnchor","locate",1,AIAnchor.AIANCHOR_ANIMALSPOT);
  337.         AI:PushGoal("AcqAnimalAnchor","acqtarget",1,"");
  338.         AI:PushGoal("AcqAnimalAnchor","ApproachAnchor");
  339.                                 
  340.         -- look at idleanchor
  341.         AI:CreateGoalPipe("LookIdleAnchor");
  342.         AI:PushGoal("LookIdleAnchor","timeout",1,0.5);                                
  343.         AI:PushGoal("LookIdleAnchor","locate",1,AIAnchor.AIANCHOR_IDLE);
  344.         AI:PushGoal("LookIdleAnchor","lookat",1,0,0);
  345.         AI:PushGoal("LookIdleAnchor","timeout",1,1,2);                                
  346.         
  347.                                 
  348.         -- approach anchor 
  349.         AI:CreateGoalPipe("ApproachAnchor");
  350.         AI:PushGoal("ApproachAnchor","timeout",1,0.5,2);
  351.         AI:PushGoal("ApproachAnchor","approach",1,2);
  352.         AI:PushGoal("ApproachAnchor","timeout",1,0.2);
  353.         AI:PushGoal("ApproachAnchor","lookat",1,0,0);
  354.         AI:PushGoal("ApproachAnchor","devalue",0);
  355.         AI:PushGoal("ApproachAnchor","timeout",1,0.2);
  356.                             
  357.         -- general idle pipe
  358.         AI:CreateGoalPipe("IdlePipe");
  359.         AI:PushGoal("IdlePipe","timeout",1,0.5,1.5);
  360.         AI:PushGoal("IdlePipe","signal",0,1,"SelectAnchor",0);
  361.         AI:PushGoal("IdlePipe","signal",0,1,"IdleStart",0);
  362.         AI:PushGoal("IdlePipe","signal",0,1,"IdleLoop",0);
  363.         AI:PushGoal("IdlePipe","timeout",0,18,22);
  364.         AI:PushGoal("IdlePipe","timeout",1,6,9);
  365.         AI:PushGoal("IdlePipe","signal",0,1,"IdleRandom",0);
  366.         AI:PushGoal("IdlePipe","branch",1,-2);
  367.         AI:PushGoal("IdlePipe","timeout",1,6,9);
  368.         AI:PushGoal("IdlePipe","signal",0,1,"IdleEnd",0);
  369.         
  370.         -- patrol idle pipe
  371.         AI:CreateGoalPipe("PatrolIdle");
  372.         AI:PushGoal("PatrolIdle","run",0,0);
  373.         AI:PushGoal("PatrolIdle","bodypos",1,0);
  374.         -- AI:PushGoal("PatrolIdle","timeout",0,8);
  375.         AI:PushGoal("PatrolIdle","timeout",1,0.5,1);
  376.         AI:PushGoal("PatrolIdle","signal",0,1,"IdleRandom",0);
  377.         AI:PushGoal("PatrolIdle","timeout",1,0.5,1);
  378.         AI:PushGoal("PatrolIdle","signal",0,1,"IdleLook",0);
  379.         -- AI:PushGoal("PatrolIdle","branch",1,-4);
  380.         AI:PushGoal("PatrolIdle","timeout",1,0.5,1);
  381.         AI:PushGoal("PatrolIdle","signal",0,1,"IdleEnd",0);
  382.         
  383.         -- pecari idel pipe
  384.         AI:CreateGoalPipe("PecariPipe");
  385.         AI:PushGoal("PecariPipe","run",1,0);
  386.         AI:PushGoal("PecariPipe","bodypos",1,0);
  387.         AI:PushGoal("PecariPipe","timeout",1,0.5,1.5);
  388.         AI:PushGoal("PecariPipe","signal",0,1,"SelectAnchor",0);
  389.         AI:PushGoal("PecariPipe","signal",0,1,"IdleStart",0);
  390.         AI:PushGoal("PecariPipe","signal",0,1,"IdleLoop",0);
  391.         AI:PushGoal("PecariPipe","timeout",0,2,3);
  392.         AI:PushGoal("PecariPipe","timeout",1,2,3);
  393.         AI:PushGoal("PecariPipe","signal",0,1,"IdleRandom",0);
  394.         AI:PushGoal("PecariPipe","branch",1,-2);
  395.         AI:PushGoal("PecariPipe","timeout",1,2,3);
  396.         AI:PushGoal("PecariPipe","signal",0,1,"IdleEnd",0);
  397.         
  398.         ------------------------------------------------------------------
  399.         ------------------------ Patrol ----------------------------------
  400.         --Outdoor
  401.                 
  402.         AI:CreateGoalPipe("JobPatrol");
  403.         AI:PushGoal("JobPatrol","run",1,0);
  404.         AI:PushGoal("JobPatrol","bodypos",1,0);
  405.         AI:PushGoal("JobPatrol","acqtarget",1,"");
  406.         AI:PushGoal("JobPatrol","signal",0,1,"RELAXED_STANCE",0);
  407.         AI:PushGoal("JobPatrol","timeout",1,1);
  408.         AI:PushGoal("JobPatrol","approach",1,2);
  409.         AI:PushGoal("JobPatrol","devalue",0);
  410.         AI:PushGoal("JobPatrol","timeout",1,0.5,1);
  411.         AI:PushGoal("JobPatrol","signal",0,1,"IdleStart",0);
  412.                 
  413.         -- Indoor
  414.         AI:CreateGoalPipe("JobPatrolIndoor");
  415.         AI:PushGoal("JobPatrolIndoor","run",1,0);
  416.         AI:PushGoal("JobPatrolIndoor","bodypos",1,0);
  417.         AI:PushGoal("JobPatrolIndoor","pathfind",1,"");
  418.         AI:PushGoal("JobPatrolIndoor","signal",0,1,"RELAXED_STANCE",0);
  419.         AI:PushGoal("JobPatrolIndoor","timeout",1,0.5);
  420.         AI:PushGoal("JobPatrolIndoor","trace",1,1);
  421.         --AI:PushGoal("JobPatrolIndoor","devalue",0);
  422.         AI:PushGoal("JobPatrolIndoor","timeout",1,0.5,1);
  423.         AI:PushGoal("JobPatrolIndoor","signal",0,1,"IdleStart",0);
  424.         ------------------------------------------------------------------
  425.         -------------------------- Hide ----------------------------------
  426.         -- SneakNearestToTarget
  427.         AI:CreateGoalPipe("SneakNearestToTarget");
  428.         AI:PushGoal("SneakNearestToTarget","bodypos",1,5);
  429.         AI:PushGoal("SneakNearestToTarget","run",1,0);
  430.         AI:PushGoal("SneakNearestToTarget","hide",1,15,HM_NEAREST_TO_TARGET);
  431.         
  432.         -- RunNearestToTarget
  433.         AI:CreateGoalPipe("AIS_RunNearestToTarget");
  434.         AI:PushGoal("AIS_RunNearestToTarget","run",1,1);
  435.         AI:PushGoal("AIS_RunNearestToTarget","hide",1,7,HM_NEAREST_TO_TARGET);
  436.         AI:PushGoal("AIS_RunNearestToTarget","signal",0,1,"AISF_GoOn",0);
  437.         
  438.         -- RunFarCoverGoOn
  439.         AI:CreateGoalPipe("AIS_PatrolRunFarCoverGoOn");
  440.         AI:PushGoal("AIS_PatrolRunFarCoverGoOn","run",1,1);
  441.         AI:PushGoal("AIS_PatrolRunFarCoverGoOn","hide",1,15,HM_FARTHEST_FROM_TARGET);
  442.         AI:PushGoal("AIS_PatrolRunFarCoverGoOn","signal",0,1,"AISF_GoOn",0);
  443.         
  444.         -- RunNearCover GoOn
  445.         AI:CreateGoalPipe("AIS_PatrolRunNearCoverGoOn");
  446.         AI:PushGoal("AIS_PatrolRunNearCoverGoOn","bodypos",0,0);
  447.         AI:PushGoal("AIS_PatrolRunNearCoverGoOn","run",0,1);
  448.         AI:PushGoal("AIS_PatrolRunNearCoverGoOn","hide",1,15,HM_NEAREST);
  449.         AI:PushGoal("AIS_PatrolRunNearCoverGoOn","signal",0,1,"AISF_GoOn",0);
  450.         ------------------------------------------------------------------
  451.         ---------------------------- Side Step ---------------------------
  452.         AI:CreateGoalPipe("AIS_SideStepLeft");
  453.         AI:PushGoal("AIS_SideStepLeft","run",1,1);
  454.         AI:PushGoal("AIS_SideStepLeft","bodypos",1,0);
  455.         AI:PushGoal("AIS_SideStepLeft","strafe",1,-1);
  456.         AI:PushGoal("AIS_SideStepLeft","timeout",1,0.5);
  457.         AI:PushGoal("AIS_SideStepLeft","strafe",1,0);
  458.         AI:PushGoal("AIS_SideStepLeft","signal",0,1,"AISF_GoOn",0);
  459.         
  460.         AI:CreateGoalPipe("AIS_SideStepRight");
  461.         AI:PushGoal("AIS_SideStepRight","run",1,1);
  462.         AI:PushGoal("AIS_SideStepRight","bodypos",1,0);
  463.         AI:PushGoal("AIS_SideStepRight","strafe",1,1);
  464.         AI:PushGoal("AIS_SideStepRight","timeout",1,0.5);
  465.         AI:PushGoal("AIS_SideStepRight","strafe",1,0);
  466.         AI:PushGoal("AIS_SideStepRight","signal",0,1,"AISF_GoOn",0);
  467.         ------------------------------------------------------------------
  468.         --------------------------- Side Strafe --------------------------
  469.         AI:CreateGoalPipe("StrafeLeftDelay");
  470.         AI:PushGoal("StrafeLeftDelay","bodypos",1,0);
  471.         AI:PushGoal("StrafeLeftDelay","strafe",1,-1);
  472.         AI:PushGoal("StrafeLeftDelay","timeout",1,0.2,0.8);
  473.         AI:PushGoal("StrafeLeftDelay","strafe",1,0);
  474.         
  475.         
  476.         AI:CreateGoalPipe("StrafeRightDelay");
  477.         AI:PushGoal("StrafeRightDelay","bodypos",1,0);
  478.         AI:PushGoal("StrafeRightDelay","strafe",1,1);
  479.         AI:PushGoal("StrafeRightDelay","timeout",1,0.2,0.8);
  480.         AI:PushGoal("StrafeRightDelay","strafe",1,0);
  481.         
  482.         ------------------------------------------------------------------
  483.         ---------------------------- Side Roll ---------------------------
  484.         AI:CreateGoalPipe("RollFromRight");
  485.         AI:PushGoal("RollFromRight","firecmd",0,0);
  486.         AI:PushGoal("RollFromRight","strafe",0,1);
  487.         AI:PushGoal("RollFromRight","signal",0,1,"PlayRollLeftAnim",0);
  488.         AI:PushGoal("RollFromRight","timeout",1,0.5);
  489.         AI:PushGoal("RollFromRight","strafe",0,0);
  490.         AI:PushGoal("RollFromRight","bodypos",0,1);
  491.         AI:PushGoal("RollFromRight","firecmd",0,1);
  492.             
  493.         AI:CreateGoalPipe("RollFromLeft");
  494.         AI:PushGoal("RollFromLeft","firecmd",0,0);
  495.         AI:PushGoal("RollFromLeft","strafe",0,-1);
  496.         AI:PushGoal("RollFromLeft","signal",0,1,"PlayRollRightAnim",0);
  497.         AI:PushGoal("RollFromLeft","timeout",1,0.5);
  498.         AI:PushGoal("RollFromLeft","strafe",0,0);
  499.         AI:PushGoal("RollFromLeft","bodypos",0,1);
  500.         AI:PushGoal("RollFromLeft","firecmd",0,1);
  501.         
  502.         ------------------------------------------------------------------
  503.         ---------------------------- Attack ---------------------------
  504.         AI:CreateGoalPipe("AIS_Fight");
  505.         AI:PushGoal("AIS_Fight","firecmd",1,1);
  506.         AI:PushGoal("AIS_Fight","bodypos",1,0);
  507.         AI:PushGoal("AIS_Fight","strafe",1,0);
  508.         AI:PushGoal("AIS_Fight","signal",0,1,"AISF_GoOn",0);
  509.         ------------------------------------------------------------------
  510.         AI:CreateGoalPipe("CoverFight");
  511.         AI:PushGoal("CoverFight","firecmd",0,1);
  512.         AI:PushGoal("CoverFight","bodypos",0,0);
  513.         -- AI:PushGoal("CoverFight","timeout",1,1,2);
  514.         AI:PushGoal("CoverFight","hide",1,10,HM_NEAREST);
  515.         
  516.         -- acquire shootspot
  517.         AI:CreateGoalPipe("AcqShootAnchor");
  518.         AI:PushGoal("AcqShootAnchor","timeout",1,0.2,0.5);
  519.         AI:PushGoal("AcqShootAnchor","pathfind",1,"");
  520.         AI:PushGoal("AcqShootAnchor","trace",1,0);
  521.         
  522.         AI:CreateGoalPipe("TraceToPlayer");
  523.         AI:PushGoal("TraceToPlayer","locate",1,"atttarget");
  524.         AI:PushGoal("TraceToPlayer","firecmd",0,1);
  525.         AI:PushGoal("TraceToPlayer","bodypos",0,0);
  526.         AI:PushGoal("TraceToPlayer","pathfind",1,"");
  527.         -- AI:PushGoal("TraceToPlayer","timeout",1,0.3,0.6);
  528.         AI:PushGoal("TraceToPlayer","trace",1,0,1);
  529.         AI:PushGoal("TraceToPlayer","timeout",1,0.3,0.6);
  530.         AI:PushGoal("TraceToPlayer","cover_scramble");
  531.         ---------------------
  532.         --
  533.         --  COVER
  534.         -- 
  535.         ---------------------
  536.         
  537.         -- interesting sound heard
  538.         -- attentive -----------------------
  539.         AI:CreateGoalPipe("cover_attentive");
  540.         AI:PushGoal("cover_attentive","bodypos",0,0);
  541.         AI:PushGoal("cover_attentive","timeout",0,10,15); -- start branch
  542.         AI:PushGoal("cover_attentive","lookat",1,-45,45);
  543.         AI:PushGoal("cover_attentive","timeout",1,3,4);
  544.         AI:PushGoal("cover_attentive","branch",1,-2);    -- end branch
  545.         AI:PushGoal("cover_attentive","signal",0,1,"back_to",0); -- change behaviour back to idle
  546.         AI:PushGoal("cover_attentive","signal",0,1,"GoOn",0); -- start proper action there
  547.         
  548.         -- investigate -----------------------        
  549.         AI:CreateGoalPipe("cover_investigate");
  550.         AI:PushGoal("cover_investigate","run",1,0);
  551.         AI:PushGoal("cover_investigate","bodypos",1,1);
  552.         AI:PushGoal("cover_investigate","bodypos",1,0);
  553.         AI:PushGoal("cover_investigate","timeout",1,1,1.5);
  554.         AI:PushGoal("cover_investigate","approach",1,0.5);
  555.         AI:PushGoal("cover_investigate","timeout",1,2,3);
  556.         AI:PushGoal("cover_investigate","signal",0,1,"Cease",0);
  557.         
  558.         -- cease -------------------------------------
  559.         AI:CreateGoalPipe("cover_cease_investigation");
  560.         AI:PushGoal("cover_cease_investigation","devalue",0);
  561.         AI:PushGoal("cover_cease_investigation","timeout",0,8,12); -- start branch
  562.         AI:PushGoal("cover_cease_investigation","signal",0,1,"Soundheard",0); -- play animation
  563.         AI:PushGoal("cover_cease_investigation","timeout",1,2,3); 
  564.         AI:PushGoal("cover_cease_investigation","lookat",1,-60,60);
  565.         AI:PushGoal("cover_cease_investigation","timeout",1,2,2.5); 
  566.         AI:PushGoal("cover_cease_investigation","branch",1,-4);    -- end branch
  567.         AI:PushGoal("cover_cease_investigation","signal",0,1,"confused_animation",0); -- play animation
  568.         AI:PushGoal("cover_cease_investigation","timeout",1,3,4);
  569.         AI:PushGoal("cover_cease_investigation","signal",0,1,"back_to",0); -- change behaviour back to idle
  570.         AI:PushGoal("cover_cease_investigation","signal",0,1,"GoOn",0);  -- start proper action there
  571.         
  572.  
  573.         
  574.         -- threatened ----------------------------        
  575.         AI:CreateGoalPipe("cover_approach_threat");
  576.         AI:PushGoal("cover_approach_threat","bodypos",1,0);
  577.         AI:PushGoal("cover_approach_threat","run",1,1);
  578.         AI:PushGoal("cover_approach_threat","hide",1,10,HM_NEAREST);
  579.     --    AI:PushGoal("cover_approach_threat","bodypos",1,1);
  580.         AI:PushGoal("cover_approach_threat","timeout",1,0.5,1);
  581.         AI:PushGoal("cover_approach_threat","run",0,0);
  582.         AI:PushGoal("cover_approach_threat","bodypos",1,5);
  583.         AI:PushGoal("cover_approach_threat","approach",1,0.8);
  584.         AI:PushGoal("cover_approach_threat","bodypos",1,0);
  585.         AI:PushGoal("cover_approach_threat","approach",1,0.5);
  586.         AI:PushGoal("cover_approach_threat","timeout",1,1);
  587.         AI:PushGoal("cover_approach_threat","signal",0,1,"Cease",0);
  588.         
  589.         -- cease -------------------------------------
  590.         AI:CreateGoalPipe("cover_cease_approach");
  591.         AI:PushGoal("cover_cease_approach","devalue",0);
  592.         AI:PushGoal("cover_cease_approach","timeout",0,8,10); -- start branch
  593.         AI:PushGoal("cover_cease_approach","signal",0,1,"target_lost_animation",0); -- play animation
  594.         AI:PushGoal("cover_cease_approach","timeout",1,2,3); 
  595.         AI:PushGoal("cover_cease_approach","lookat",1,-60,60);
  596.         AI:PushGoal("cover_cease_approach","timeout",1,2,2.5); 
  597.         AI:PushGoal("cover_cease_approach","branch",1,-4);    -- end branch
  598.         AI:PushGoal("cover_cease_approach","timeout",1,1);
  599.         AI:PushGoal("cover_cease_approach","signal",0,1,"confused_animation",0); -- play animation
  600.         AI:PushGoal("cover_cease_approach","timeout",1,2,3);
  601.         AI:PushGoal("cover_cease_approach","signal",0,1,"back_to",0); -- change behaviour back to idle
  602.         AI:PushGoal("cover_cease_approach","signal",0,1,"GoOn",0);  -- start proper action there
  603.             
  604.         
  605.         -- go for cover
  606.         AI:CreateGoalPipe("cover_goforcover");
  607.         AI:PushGoal("cover_goforcover","locate",0,"beacon");
  608.         AI:PushGoal("cover_goforcover","acqtarget",0,"");
  609.         AI:PushGoal("cover_goforcover","bodypos",1,0);
  610.         AI:PushGoal("cover_goforcover","run",1,1);
  611.         AI:PushGoal("cover_goforcover","hide",1,10,HM_NEAREST);
  612.         AI:PushGoal("cover_goforcover","devalue",0);
  613.         AI:PushGoal("cover_goforcover","timeout",1,0.25,0.5);
  614.         AI:PushGoal("cover_goforcover","lookat",1,180);
  615.         AI:PushGoal("cover_goforcover","timeout",1,1,1.5);
  616.         AI:PushGoal("cover_goforcover","locate",0,"beacon");
  617.         AI:PushGoal("cover_goforcover","acqtarget",0,"");
  618.         AI:PushGoal("cover_goforcover","cover_approach_threat");
  619.                     
  620.                     
  621.         ---------------------
  622.         --
  623.         --  REAR 
  624.         -- 
  625.         ---------------------
  626.         
  627.         -- interesting sound heard
  628.         -- attentive -----------------------
  629.         AI:CreateGoalPipe("rear_attentive");
  630.         AI:PushGoal("rear_attentive","bodypos",0,0);
  631.         AI:PushGoal("rear_attentive","timeout",0,15,20); -- start branch
  632.         AI:PushGoal("rear_attentive","lookat",1,-75,75);
  633.         AI:PushGoal("rear_attentive","timeout",1,3,4);
  634.         AI:PushGoal("rear_attentive","branch",1,-2);    -- end branch
  635.         AI:PushGoal("rear_attentive","signal",0,1,"back_to",0); -- change behaviour back to idle
  636.         AI:PushGoal("rear_attentive","signal",0,1,"GoOn",0); -- start proper action there
  637.         
  638.         -- investigate -----------------------        
  639.         AI:CreateGoalPipe("rear_investigate");
  640.         AI:PushGoal("rear_investigate","run",1,0);
  641.         AI:PushGoal("rear_investigate","bodypos",1,5);
  642.         AI:PushGoal("rear_investigate","timeout",1,0.5,0.75);
  643.         AI:PushGoal("rear_investigate","approach",1,0.75);
  644.         AI:PushGoal("rear_investigate","timeout",1,0.2,0.3);
  645.         AI:PushGoal("rear_investigate","lookat",1,35,55);
  646.         AI:PushGoal("rear_investigate","timeout",1,0.2,0.3);
  647.         AI:PushGoal("rear_investigate","lookat",1,-35,-55);
  648.         AI:PushGoal("rear_investigate","timeout",1,2,3);
  649.         AI:PushGoal("rear_investigate","signal",0,1,"Cease",0);
  650.          
  651.          -- cease -------------------------------------
  652.         AI:CreateGoalPipe("rear_cease_investigation");
  653.         AI:PushGoal("rear_cease_investigation","devalue",0);
  654.         AI:PushGoal("rear_cease_investigation","timeout",0,8,12); -- start branch
  655.         AI:PushGoal("rear_cease_investigation","signal",0,1,"target_lost_animation",0); -- play animation
  656.         AI:PushGoal("rear_cease_investigation","timeout",1,2.5,3); 
  657.         AI:PushGoal("rear_cease_investigation","lookat",1,-55,55);
  658.         AI:PushGoal("rear_cease_investigation","timeout",1,3); 
  659.         AI:PushGoal("rear_cease_investigation","branch",1,-4);    -- end branch
  660.         AI:PushGoal("rear_cease_investigation","bodypos",1,0);
  661.         AI:PushGoal("rear_cease_investigation","timeout",1,1,2);
  662.         AI:PushGoal("rear_cease_investigation","signal",0,1,"confused_animation",0); -- play animation
  663.         AI:PushGoal("rear_cease_investigation","timeout",1,2,3);
  664.         AI:PushGoal("rear_cease_investigation","signal",0,1,"back_to",0); -- change behaviour back to idle
  665.         AI:PushGoal("rear_cease_investigation","signal",0,1,"GoOn",0);  -- start proper action there
  666.         
  667.         -- threatening sound heard
  668.         -- disturbed -----------------------
  669.         AI:CreateGoalPipe("rear_disturbed");
  670.         AI:PushGoal("rear_disturbed","bodypos",0,5);
  671.         AI:PushGoal("rear_disturbed","timeout",0,15,20); -- start branch
  672.         AI:PushGoal("rear_disturbed","lookat",1,-120,120);
  673.         AI:PushGoal("rear_disturbed","timeout",1,0.5,1);
  674.         AI:PushGoal("rear_disturbed","branch",1,-2); -- end branch
  675.         AI:PushGoal("rear_disturbed","timeout",1,4,6);
  676.         AI:PushGoal("rear_disturbed","signal",0,1,"back_to",0); -- change behaviour back to idle
  677.         AI:PushGoal("rear_disturbed","signal",0,1,"GoOn",0);  -- start proper action there
  678.                 
  679.         -- threatened ----------------------------        
  680.         AI:CreateGoalPipe("rear_approach_threat");
  681.         AI:PushGoal("rear_approach_threat","bodypos",1,0);
  682.         AI:PushGoal("rear_approach_threat","run",1,1);
  683.         AI:PushGoal("rear_approach_threat","hide",1,10,HM_NEAREST_TO_TARGET);
  684.         AI:PushGoal("rear_approach_threat","timeout",1,0.5,1);
  685.         AI:PushGoal("rear_approach_threat","run",0,0);
  686.         AI:PushGoal("rear_approach_threat","approach",1,0.8);
  687.         AI:PushGoal("rear_approach_threat","bodypos",1,5);
  688.         AI:PushGoal("rear_approach_threat","approach",1,0.8);
  689.         AI:PushGoal("rear_approach_threat","timeout",1,1);
  690.         AI:PushGoal("rear_approach_threat","signal",0,1,"Cease",0);
  691.         
  692.         -- cease --------------------------------
  693.         AI:CreateGoalPipe("rear_cease_approach");
  694.         AI:PushGoal("rear_cease_approach","devalue",0);
  695.         AI:PushGoal("rear_cease_approach","timeout",0,8,12);  -- start branch
  696.         AI:PushGoal("rear_cease_approach","signal",0,1,"target_lost_animation",0); -- play animation
  697.         AI:PushGoal("rear_cease_approach","timeout",1,3,3.5); 
  698.         AI:PushGoal("rear_cease_approach","lookat",1,-65,65);
  699.         AI:PushGoal("rear_cease_approach","timeout",1,3);
  700.         AI:PushGoal("rear_cease_approach","branch",1,-4); -- end branch    
  701.         AI:PushGoal("rear_cease_approach","bodypos",1,0);
  702.         AI:PushGoal("rear_cease_approach","timeout",1,1,2);
  703.         AI:PushGoal("rear_cease_approach","signal",0,1,"confused_animation",0); -- play animation
  704.         AI:PushGoal("rear_cease_approach","timeout",1,2,3);
  705.         AI:PushGoal("rear_cease_approach","signal",0,1,"back_to",0); -- change behaviour back to idle
  706.         AI:PushGoal("rear_cease_approach","signal",0,1,"GoOn",0); -- start proper action there
  707.         
  708.         
  709.         
  710.         
  711.         -- got shoot from, no clue who -----------------
  712.         AI:CreateGoalPipe("rear_lookaround_threatened");
  713.         AI:PushGoal("rear_lookaround_threatened","bodypos",1,1);
  714.         AI:PushGoal("rear_lookaround_threatened","timeout",0,10,15);  -- start branch
  715.         AI:PushGoal("rear_lookaround_threatened","LookForThreat");
  716.         AI:PushGoal("rear_lookaround_threatened","branch",1,-1);  -- end branch    
  717.         AI:PushGoal("rear_lookaround_threatened","bodypos",0,0);
  718.         AI:PushGoal("rear_lookaround_threatened","timeout",1,2,3);
  719.         AI:PushGoal("rear_lookaround_threatened","signal",0,1,"back_to",0); -- change behaviour back to idle
  720.         AI:PushGoal("rear_lookaround_threatened","signal",0,1,"GoOn",0); -- start proper action there
  721.                         
  722.         -- prone, because there is not cover and you got shot
  723.         AI:CreateGoalPipe("rear_nocover_prone");
  724.         AI:PushGoal("rear_nocover_prone","signal",0,1,"PlayGetDownAnim",0);
  725.         AI:PushGoal("rear_nocover_prone","timeout",1,2);
  726.         AI:PushGoal("rear_nocover_prone","bodypos",1,2);    
  727.         AI:PushGoal("rear_nocover_prone","devalue",0);
  728.         AI:PushGoal("rear_nocover_prone","timeout",0,13,17);  -- start branch
  729.         AI:PushGoal("rear_nocover_prone","timeout",1,3,6);
  730.         AI:PushGoal("rear_nocover_prone","lookat",1,50,-50);
  731.         AI:PushGoal("rear_nocover_prone","branch",1,-2); -- end branch
  732.         AI:PushGoal("rear_nocover_prone","timeout",1,2,3);
  733.         AI:PushGoal("rear_nocover_prone","signal",0,1,"PlayGetUpAnim",0);
  734.         AI:PushGoal("rear_nocover_prone","timeout",1,2);
  735.         AI:PushGoal("rear_nocover_prone","bodypos",1,0);
  736.         AI:PushGoal("rear_nocover_prone","timeout",0,7,12);  -- start branch
  737.         AI:PushGoal("rear_nocover_prone","timeout",1,2,5);
  738.         AI:PushGoal("rear_nocover_prone","lookat",1,35,-35);
  739.         AI:PushGoal("rear_nocover_prone","branch",1,-2); -- end branch
  740.         AI:PushGoal("rear_nocover_prone","timeout",1,3,4);
  741.         AI:PushGoal("rear_nocover_prone","signal",0,1,"back_to",0); -- change behaviour back to idle
  742.         AI:PushGoal("rear_nocover_prone","signal",0,1,"GoOn",0); -- start proper action there
  743.         
  744.         -- received damage or bullet rain
  745.         AI:CreateGoalPipe("rear_crouchlook");
  746.         AI:PushGoal("rear_crouchlook","bodypos",1,1);
  747.         AI:PushGoal("rear_crouchlook","devalue",0);
  748.         AI:PushGoal("rear_crouchlook","timeout",0,7,10);  -- start branch
  749.         AI:PushGoal("rear_crouchlook","lookat",1,50,-50);
  750.         AI:PushGoal("rear_crouchlook","timeout",1,2,4);
  751.         AI:PushGoal("rear_crouchlook","branch",1,-2); -- end branch
  752.         AI:PushGoal("rear_crouchlook","bodypos",1,0);
  753.         AI:PushGoal("rear_crouchlook","timeout",0,7,10);  -- start branch
  754.         AI:PushGoal("rear_crouchlook","timeout",1,3,6);
  755.         AI:PushGoal("rear_crouchlook","lookat",1,50,-50);
  756.         AI:PushGoal("rear_crouchlook","branch",1,-2); -- end branch
  757.         AI:PushGoal("rear_crouchlook","signal",0,1,"back_to",0); -- change behaviour back to idle
  758.         AI:PushGoal("rear_crouchlook","signal",0,1,"GoOn",0); -- start proper action there
  759.         
  760.         -- go for cover
  761.         AI:CreateGoalPipe("rear_goforcover");
  762.         AI:PushGoal("rear_goforcover","locate",0,"beacon");
  763.         AI:PushGoal("rear_goforcover","acqtarget",0,"");
  764.         AI:PushGoal("rear_goforcover","bodypos",1,0);
  765.         AI:PushGoal("rear_goforcover","run",1,1);
  766.         AI:PushGoal("rear_goforcover","hide",1,10,HM_NEAREST);
  767.         AI:PushGoal("rear_goforcover","devalue",0);
  768.         AI:PushGoal("rear_goforcover","bodypos",1,1);
  769.         AI:PushGoal("rear_goforcover","timeout",1,0.25,0.5);
  770.         AI:PushGoal("rear_goforcover","timeout",0,10,12); -- start branch
  771.         AI:PushGoal("rear_goforcover","lookat",1,50,-50);
  772.         AI:PushGoal("rear_goforcover","timeout",1,1,1.5);
  773.         AI:PushGoal("rear_goforcover","branch",1,-2); -- end branch
  774.         AI:PushGoal("rear_goforcover","locate",0,"beacon");
  775.         AI:PushGoal("rear_goforcover","acqtarget",0,"");
  776.         AI:PushGoal("rear_goforcover","rear_approach_threat");
  777.         
  778.         -- heads up, and go -------------
  779.         AI:CreateGoalPipe("rear_headup");
  780.         AI:PushGoal("rear_headup","locate",0,"beacon");
  781.         AI:PushGoal("rear_headup","acqtarget",0,"");
  782.         AI:PushGoal("rear_headup","bodypos",1,0);
  783.         AI:PushGoal("rear_headup","run",1,1);
  784.         AI:PushGoal("rear_headup","hide",1,10,HM_NEAREST_TO_TARGET);
  785.         AI:PushGoal("rear_headup","timeout",1,1,1.5);
  786.         AI:PushGoal("rear_headup","approach",1,0.9);
  787.         
  788.         
  789.         -- Attack Modes
  790.         -- comeout 
  791.         AI:CreateGoalPipe("rear_comeout2");
  792.         AI:PushGoal("rear_comeout2","bodypos",0,1);
  793.         AI:PushGoal("rear_comeout2","firecmd",0,1);
  794.         AI:PushGoal("rear_comeout2","approach",1,0.9);
  795.         AI:PushGoal("rear_comeout2","timeout",1,2,4);
  796.         AI:PushGoal("rear_comeout2","signal",0,1,"REAR_SELECTATTACK",0);
  797.         
  798.         -- left cover
  799.         AI:CreateGoalPipe("rear_takeleftcover");
  800.         AI:PushGoal("rear_takeleftcover","bodypos",1,0);
  801.         AI:PushGoal("rear_takeleftcover","run",1,1);
  802.         AI:PushGoal("rear_takeleftcover","hide",1,10,HM_LEFTMOST_FROM_TARGET);
  803.         AI:PushGoal("rear_takeleftcover","approach",1,0.9);
  804.         AI:PushGoal("rear_takeleftcover","firecmd",0,1);
  805.         AI:PushGoal("rear_takeleftcover","timeout",1,0.7,1.3);
  806.         AI:PushGoal("rear_takeleftcover","signal",0,1,"REAR_SELECTATTACK",0);
  807.         
  808.         -- right cover
  809.         AI:CreateGoalPipe("rear_takerightcover");
  810.         AI:PushGoal("rear_takerightcover","bodypos",1,0);
  811.         AI:PushGoal("rear_takerightcover","run",1,1);
  812.         AI:PushGoal("rear_takerightcover","hide",1,10,HM_RIGHTMOST_FROM_TARGET);
  813.         AI:PushGoal("rear_takerightcover","approach",1,0.9);
  814.         AI:PushGoal("rear_takerightcover","firecmd",0,1);
  815.         AI:PushGoal("rear_takerightcover","timeout",1,0.7,1.3);
  816.         AI:PushGoal("rear_takerightcover","signal",0,1,"REAR_SELECTATTACK",0);
  817.         
  818. -- ______________________________________________________________________________________________________________________        
  819. -- -------------------------------------------------- SHARED SCRIPTS ----------------------------------------------------
  820.  
  821.  
  822.  
  823.  
  824.         
  825.         
  826. end
  827.  
  828.